﻿//namespace ApplicationFrame.EntityFrameworkCore.Core
//{
//    /// <summary>
//    /// 时间哈希复合分表
//    /// </summary>
//    [AttributeUsage(AttributeTargets.Class)]
//    public class TimeHashShardingAttribute : Attribute
//    {
//        /// <summary>
//        /// 时间分表类型
//        /// </summary>
//        public TimeShardingGranularity TimeGranularity { get; }

//        /// <summary>
//        /// 每个时间分区内的哈希分表数量（2的幂次方）
//        /// </summary>
//        public int HashTableCount { get; }

//        public TimeHashShardingAttribute(TimeShardingGranularity timeGranularity = TimeShardingGranularity.Month, int hashTableCount = 4)
//        {
//            TimeGranularity = timeGranularity;
//            if (hashTableCount <= 0 || (hashTableCount & (hashTableCount - 1)) != 0)
//                throw new ArgumentException("哈希分表数量必须是2的幂次方", nameof(hashTableCount));
//            HashTableCount = hashTableCount;
//        }
//    }
//}
